package com.zwh.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zwh.bean.Dept;
import com.zwh.dao.DeptDao;
import com.zwh.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptDao dao;
    @Override
    public List<Dept> getAll() {
        return dao.selectList(null);
    }

    @Override
    public Dept getById( Integer id) {
        return dao.selectById(id);
    }

    @Override
    public List<Dept> getMoreById(List<Integer> list) {
        return dao.selectBatchIds(list);
    }

    @Override
    public int deleteById(Integer id) {
        return dao.deleteById(id);
    }

    @Override
    public int deleteMoreById(List<Integer> list) {
        return dao.deleteBatchIds(list);
    }

    @Override
    public int insert(Dept dept) {
        return dao.insert(dept);
    }

    @Override
    public int updateById(Dept dept) {
        return dao.updateById(dept);
    }

    @Override
    public IPage selectPage(IPage page) {
        return dao.selectPage(page,null);
    }

    @Override
    public IPage selectPage(IPage page, QueryWrapper wrapper) {
        return dao.selectPage(page,wrapper);
    }
}
